how to check if url has hash in react

85

how to check if url has hash in react -

if(window.location.hash) {
  // Fragment exists
} else {
  // Fragment doesn't exist
}

Comments

Submit
0 Comments